package com.bq.gametrade.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import com.bq.gametrade.GameTradeApplication;
import com.bq.gametrade.ui.dialog.LoadingProgressDialog;

/**
 * 功能：
 * <p>
 *
 * @author Feel on 2016/12/8 17:34
 */

public class BaseFragment extends Fragment{

    protected GameTradeApplication application;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        application = GameTradeApplication.getInstance();
    }


    protected LoadingProgressDialog dialog;

    public void showSpotsDialog() {
        if (dialog == null) {
            dialog = new LoadingProgressDialog(getActivity());
        }
        dialog.show();
    }

    public void showSpotsDialog(String title) {
        if (dialog == null) {
            dialog = new LoadingProgressDialog(getActivity(),title);
        }
        dialog.show();
    }

    public void closeSpotsDialog() {
        if (dialog != null) {
            dialog.dismiss();
        }
    }

}
